home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / ENTRPRIS / POOLMGR / PMGR_SVR.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-23  |  7.1 KB  |  217 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPoolMngr 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Pool Manager Server"
  5.    ClientHeight    =   2820
  6.    ClientLeft      =   3450
  7.    ClientTop       =   4215
  8.    ClientWidth     =   5340
  9.    LinkTopic       =   "Form1"
  10.    LockControls    =   -1  'True
  11.    MaxButton       =   0   'False
  12.    PaletteMode     =   1  'UseZOrder
  13.    ScaleHeight     =   2820
  14.    ScaleWidth      =   5340
  15.    Begin VB.CommandButton cmdDelete 
  16.       Caption         =   "&Delete"
  17.       Height          =   315
  18.       Left            =   4335
  19.       TabIndex        =   13
  20.       Top             =   1305
  21.       Width           =   900
  22.    End
  23.    Begin VB.CommandButton cmdUpdate 
  24.       Caption         =   "&Update"
  25.       Height          =   315
  26.       Left            =   4335
  27.       TabIndex        =   12
  28.       Top             =   900
  29.       Width           =   900
  30.    End
  31.    Begin VB.CommandButton cmdAdd 
  32.       Caption         =   "&Add"
  33.       Height          =   315
  34.       Left            =   4335
  35.       TabIndex        =   11
  36.       Top             =   495
  37.       Width           =   900
  38.    End
  39.    Begin VB.Frame fraSettings 
  40.       Caption         =   "Server Pool Settings"
  41.       BeginProperty Font 
  42.          Name            =   "MS Sans Serif"
  43.          Size            =   8.25
  44.          Charset         =   0
  45.          Weight          =   700
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   1845
  51.       Left            =   120
  52.       TabIndex        =   3
  53.       Top             =   870
  54.       Width           =   3870
  55.       Begin VB.TextBox txtCloseDelay 
  56.          Alignment       =   1  'Right Justify
  57.          Height          =   285
  58.          Left            =   3180
  59.          TabIndex        =   10
  60.          Text            =   "0"
  61.          Top             =   960
  62.          Width           =   495
  63.       End
  64.       Begin VB.TextBox txtMaxPool 
  65.          Alignment       =   1  'Right Justify
  66.          Height          =   285
  67.          Left            =   3180
  68.          TabIndex        =   9
  69.          Text            =   "0"
  70.          Top             =   630
  71.          Width           =   495
  72.       End
  73.       Begin VB.TextBox txtMinPool 
  74.          Alignment       =   1  'Right Justify
  75.          Height          =   285
  76.          Left            =   3180
  77.          TabIndex        =   8
  78.          Text            =   "0"
  79.          Top             =   300
  80.          Width           =   495
  81.       End
  82.       Begin VB.CheckBox chkCreateAhead 
  83.          Caption         =   "Use C&reate Ahead"
  84.          Height          =   255
  85.          Left            =   180
  86.          TabIndex        =   4
  87.          Top             =   1440
  88.          Width           =   2055
  89.       End
  90.       Begin VB.Label Label1 
  91.          Caption         =   "&Close Delay (seconds)"
  92.          Height          =   240
  93.          Index           =   3
  94.          Left            =   180
  95.          TabIndex        =   7
  96.          Top             =   1035
  97.          Width           =   2130
  98.       End
  99.       Begin VB.Label Label1 
  100.          Caption         =   "Mi&nimum Pool Size"
  101.          Height          =   240
  102.          Index           =   1
  103.          Left            =   180
  104.          TabIndex        =   6
  105.          Top             =   375
  106.          Width           =   1785
  107.       End
  108.       Begin VB.Label Label1 
  109.          Caption         =   "Ma&ximum Pool Size"
  110.          Height          =   240
  111.          Index           =   2
  112.          Left            =   180
  113.          TabIndex        =   5
  114.          Top             =   705
  115.          Width           =   1965
  116.       End
  117.    End
  118.    Begin VB.CommandButton cmdClose 
  119.       Caption         =   "Close"
  120.       Height          =   315
  121.       Left            =   4335
  122.       TabIndex        =   2
  123.       Top             =   90
  124.       Width           =   900
  125.    End
  126.    Begin VB.ComboBox cboServers 
  127.       Height          =   315
  128.       Left            =   120
  129.       TabIndex        =   0
  130.       Text            =   "cboServers"
  131.       Top             =   390
  132.       Width           =   3900
  133.    End
  134.    Begin VB.Label Label1 
  135.       Caption         =   "Managed &Servers"
  136.       BeginProperty Font 
  137.          Name            =   "MS Sans Serif"
  138.          Size            =   8.25
  139.          Charset         =   0
  140.          Weight          =   700
  141.          Underline       =   0   'False
  142.          Italic          =   0   'False
  143.          Strikethrough   =   0   'False
  144.       EndProperty
  145.       Height          =   240
  146.       Index           =   0
  147.       Left            =   120
  148.       TabIndex        =   1
  149.       Top             =   135
  150.       Width           =   2100
  151.    End
  152. Attribute VB_Name = "frmPoolMngr"
  153. Attribute VB_GlobalNameSpace = False
  154. Attribute VB_Creatable = False
  155. Attribute VB_TemplateDerived = False
  156. Attribute VB_PredeclaredId = True
  157. Attribute VB_Exposed = False
  158. Option Explicit
  159. Private Sub cboServers_Click()
  160.   Dim nPrjNode As Integer
  161.       
  162.   If cboServers.ListIndex < 0 Then Exit Sub
  163.   nPrjNode = cboServers.ItemData(cboServers.ListIndex)
  164.   If nPrjNode < 0 Then Exit Sub
  165.   txtMinPool.Text = Format$(gaPrjInfo(nPrjNode).intMinUseCount)
  166.   txtMaxPool.Text = Format$(gaPrjInfo(nPrjNode).intMaxUseCount)
  167.   txtCloseDelay.Text = Format$(gaPrjInfo(nPrjNode).intCloseDelay)
  168.   If gaPrjInfo(nPrjNode).bLookAheadCreate Then
  169.     chkCreateAhead.Value = vbChecked
  170.   Else
  171.     chkCreateAhead.Value = vbUnchecked
  172.   End If
  173. End Sub
  174. Private Sub cmdClose_Click()
  175.     Unload frmPoolMngr
  176. End Sub
  177. Private Sub Form_Load()
  178.   Dim nPrjNode As Integer
  179.   InitProjectArray
  180.   nPrjNode = gnFirstPrjNode
  181.   While nPrjNode <> gnNIL
  182.     cboServers.AddItem gaPrjInfo(nPrjNode).strProgID
  183.     cboServers.ItemData(cboServers.NewIndex) = nPrjNode
  184.     nPrjNode = gaPrjInfo(nPrjNode).Next
  185.   Wend
  186.   If cboServers.ListCount > 0 Then cboServers.ListIndex = 0
  187. #If gbDEBUG Then       'Debug code... use for testing without external client
  188.   Dim bSuccess  As Integer
  189.   Dim nProjID  As Integer
  190.   Dim objPoolMngr As Object
  191.   Dim objInterface  As Object
  192.   Dim objServer As Object
  193.   Dim objSimple  As Object
  194.   Set objPoolMngr = CreateObject("PoolMngrProj.PoolMngrClass")
  195.   Exit Sub
  196.   Set objInterface = objPoolMngr.objGetProjInstance("InterfaceProj.ServerInterface", nProjID)
  197.   Set objServer = objInterface.objGetClassInstance("InterfaceDateClass")
  198.   Debug.Print objServer.GetDate
  199.   Set objServer = Nothing
  200.   Set objServer = objInterface.objGetClassInstance("InterfaceTimeClass")
  201.   Debug.Print objServer.GetTime
  202.   Set objServer = Nothing
  203.   bSuccess = objPoolMngr.ReturnProjInstance("InterfaceProj.ServerInterface", nProjID)
  204.   Set objSimple = objPoolMngr.objGetProjInstance("SimpleProj.SimpleTimeClass", nProjID)
  205.   Debug.Print objSimple.GetTime
  206.   bSuccess = objPoolMngr.ReturnProjInstance("SimpleProj.SimpleTimeClass", nProjID)
  207.   Set objPoolMngr = Nothing
  208. #End If
  209. End Sub
  210. Private Sub Form_Unload(Cancel As Integer)
  211.   If MsgBox("Warning: Closing the Pool Manager will terminate all open servers it is managing", vbOKCancel + vbCritical) = vbOK Then
  212.     CloseOpenServers
  213.   Else
  214.     Cancel = True
  215.   End If
  216. End Sub
  217.